from ucolor import ColorRGBA, ColorHSLA, ColorHSVA


def test_magic_methods() -> None:
    assert (ColorRGBA.white == ColorRGBA.white) is True
    assert (ColorRGBA.white == ColorRGBA.black) is False
    assert (ColorRGBA.white != ColorRGBA.white) is False
    assert (ColorRGBA.white != ColorRGBA.black) is True

    assert (ColorHSLA.white == ColorHSLA.white) is True
    assert (ColorHSLA.white == ColorHSLA.black) is False
    assert (ColorHSLA.white != ColorHSLA.white) is False
    assert (ColorHSLA.white != ColorHSLA.black) is True

    assert (ColorHSVA.white == ColorHSVA.white) is True
    assert (ColorHSVA.white == ColorHSVA.black) is False
    assert (ColorHSVA.white != ColorHSVA.white) is False
    assert (ColorHSVA.white != ColorHSVA.black) is True


def test_lerp() -> None:
    assert ColorRGBA.lerp(
        ColorRGBA.white,
        ColorRGBA.black,
        0
    ) == ColorRGBA.white

    assert ColorRGBA.lerp(
        ColorRGBA.white,
        ColorRGBA.black,
        0.5
    ) == ColorRGBA(127.5, 127.5, 127.5)

    assert ColorRGBA.lerp(
        ColorRGBA.white,
        ColorRGBA.black,
        1
    ) == ColorRGBA.black

    assert ColorRGBA.lerp(
        ColorRGBA.white,
        ColorRGBA.black,
        0.5
    ) == ColorRGBA.mix(ColorRGBA.white, ColorRGBA.black)

    

